<template>
  <div class="left-chart-3">
    <!-- <div class="lc3-header">路口红绿灯状态</div>
    <div class="lc3-details">设备运行总数<span>245</span></div>
    <dv-capsule-chart class="lc3-chart" :config="config" /> -->
    <dv-charts :option="option" class="lc3-chart" />
  </div>
</template>

<script>
export default {
  name: "LeftChart3",
  data() {
    return {
      option: {
        title: {
          text: "路口通行趋势",
          style: {
            fill: "#fff",
          },
        },
        legend: {
          data: [
            {
              name: "销售额",
              color: "#aeeff0",
            },
            {
              name: "人流量",
              color: "#f1829f",
            },
          ],
          textStyle: {
            fill: "#fff",
          },
        },
        xAxis: {
          data: ["周一", "周二", "周三", "周四", "周五", "周六", "周日"],
          axisLabel: {
            style: {
              stroke: "#fff",
            },
          },
        },
        yAxis: [
          {
            name: "车流量",
            nameTextStyle: {
              fill: "#fff",
            },
            data: "value",
            axisLabel: {
              style: {
                stroke: "#fff",
              },
            },
          },
          {
            name: "拥堵程度",
            nameTextStyle: {
              fill: "#fff",
            },
            data: "value",
            position: "right",
            max: 200,
            splitLine: {
              show: false,
            },
            axisLabel: {
              style: {
                stroke: "#fff",
              },
            },
          },
        ],
        series: [
          {
            name: "拥堵程度",
            data: [100, 200, 100, 100, 100, 100, 100],
            type: "line",
            smooth: true,
            lineArea: {
              show: true,
              gradient: ["rgba(251, 114, 147, 1)", "rgba(251, 114, 147, 0)"],
            },
            lineStyle: {
              stroke: "rgba(251, 114, 147, 1)",
              lineDash: [3, 3],
            },
            linePoint: {
              style: {
                stroke: "rgba(251, 114, 147, 1)",
              },
            },
            yAxisIndex: 1,
          },
          {
            name: "车流量",
            data: [100, 100, 100, 200, 100, 100, 100],
            type: "bar",
            gradient: {
              color: ["rgba(103, 224, 227, .6)", "rgba(103, 224, 227, .1)"],
            },
            barStyle: {
              stroke: "rgba(103, 224, 227, 1)",
            },
          },
        ],
      },
    };
  },
};
</script>

<style lang="less">
.left-chart-3 {
  width: 100%;
  height: 33%;
  display: flex;
  flex-direction: column;

  .lc3-header {
    height: 20px;
    line-height: 20px;
    font-size: 16px;
    text-indent: 20px;
    margin-top: 10px;
  }

  .lc3-details {
    height: 40px;
    font-size: 16px;
    display: flex;
    align-items: center;
    text-indent: 20px;

    span {
      color: #096dd9;
      font-weight: bold;
      font-size: 35px;
      margin-left: 20px;
    }
  }

  .lc3-chart {
    flex: 1;
  }
}
</style>
